<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>会员资料编辑-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/weadmin.css}">
    <!--&lt;!&ndash;[if lt IE 9]>-->
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <script th:src="@{/js/jquery.js}" charset="utf-8"></script>
    <!--<![endif]&ndash;&gt;-->
</head>
<style type="text/css">
    .layui-form-label {
        width: 150px;
    }
</style>
<body>
<div class="weadmin-body">
    <!--/*@thymesVar id="data" type="com.leo.quartz.common.response.task.MyJobVO"*/-->
    <form class="layui-form">
        <div class="layui-form-item">
            <label for="L_jobId" class="layui-form-label">
                <span class="we-red">*</span>任务Id
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_jobId" name="id" disabled="disabled" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_jobName" class="layui-form-label">
                <span class="we-red">*</span>任务名称
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_jobName" name="jobName" autocomplete="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_groupName" class="layui-form-label">
                <span class="we-red">*</span>任务分组
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_groupName" name="groupName" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_desc" class="layui-form-label">
                <span class="we-red">*</span>任务描述
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_desc" name="jobDesc" autocomplete="off" class="layui-input">
            </div>

        </div>
        <div class="layui-form-item">
            <label for="L_class" class="layui-form-label">
                <span class="we-red"></span>类路径
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_class" name="jobClass" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_status" class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <select id="L_status" name="jobDetailStatus" class="layui-select">
                    <option th:value="LIVE" selected="selected">新创建</option>
                    <option th:value="USING">使用中</option>
                    <option th:value="DEPRECATED">-已过期-</option>
                    <option th:value="UN_KNOW">未知</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <button class="layui-btn" lay-filter="add" lay-submit="">确定</button>
        </div>
    </form>
</div>
<script th:src="@{/layui/layui.js}" charset="utf-8"></script>
<script type="text/javascript" th:inline="javascript">
    layui.extend({
        admin: '{/}../js/admin'
    });
    layui.use(['form', 'jquery', 'admin', 'layer', 'laydate'], function () {
        var form = layui.form,
            $ = layui.jquery,
            admin = layui.admin,
            layer = layui.layer,
            laydate = layui.laydate;
        //监听提交
        form.on('submit(add)', function (data) {
            console.log(data);
            //发异步，把数据提交给php
            $.ajax({
                url: "../quartz/addJob",
                type: "post",
                data: data.field,
                dataType: "json",
                success: function (data) {
                    var msg;
                    if (0 == data.code) {
                        msg="增加成功";
                    }else {
                        msg="增加失败";
                    }
                    layer.alert(msg, {
                        icon: 6
                    }, function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    });
                }
            });

            return false;
        });


    });
</script>
</body>

</html>